﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$DefaultDbConnection$" formatter="bizobj of Contact(addresses(country))">
	<Sql>
		SELECT
		c.id AS id
		,lastName
		,firstName
		,middleName
		,phone
		,mobile
		,email
		,isUser
		,c.typeId
		,companyId
		,addresses.id AS addressesId
		,street1 as addressesStreet1
		,street2 as addressesStreet2
		,street3 as addressesStreet3
		,city as addressesCity
		,stateProvince as addressesStateProvince
		,zipCode as addressesZipCode
		,contactId as addressesContactId
		,countries.code as countryregionCode
		,countries.englishName as countryEnglishName
		FROM Contacts c
		LEFT JOIN ADDRESSES ON ADDRESSES.CONTACTID = c.ID
		LEFT join countries on countries.code  = ADDRESSES.countryCode
		WHERE c.id=@id
	</Sql>
	<Sql type="SqlServer">
		
	</Sql>
	<Param name="id" type="UniqueIdentifier" />
</AdoNetDataAccess>